import request from '@/utils/request'
import { thirdFilmProxy } from './baseUrl'

export function hotList(params) {
  return request({
    url: `${thirdFilmProxy}/p/films/hot`,
    method: 'GET',
    params
  })
}

export function soonList(params) {
  return request({
    url: `${thirdFilmProxy}/p/films/soon`,
    method: 'GET',
    params
  })
}

export function filmDetail(filmId, params) {
  return request({
    url: `${thirdFilmProxy}/p/films/${filmId}`,
    method: 'GET',
    params
  })
}

//获取城市列表
export function getCityList() {
  return request({
    url: `${thirdFilmProxy}/p/location/cities`,
    method: 'GET'
  })
}

//通过经纬度获取城市信息
export function getLocate({ longitude, latitude }) {
  return request({
    url: `${thirdFilmProxy}/p/locate?location=${longitude},${latitude}`,
    method: 'GET'
  })
}

// 获取影院列表
export function getCinemaList(params) {
  return request({
    url: `${thirdFilmProxy}/p/films/cinemas`,
    method: 'GET',
    params
  })
}